﻿using System;
using System.Windows.Input;

namespace MarkdownRow.Edit;

public class LinkCommand : ICommand
{
    public bool CanExecute(object? parameter) => true;

    public void Execute(object? parameter)
    {
        if(parameter is not string url)return;
        
        try
        {
            Markdown.Avalonia.Utils.DefaultHyperlinkCommand.GoTo(url);
        }
        catch
        {
            // 
        }
    }

    public event EventHandler? CanExecuteChanged;
}